package colin.spring.boot.sample.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import colin.spring.boot.sample.web.service.LoggerService;

@Controller
public class ReactController {

	@Autowired
	private LoggerService loggerService;

	@RequestMapping(value = "showReactIndex.html", method = RequestMethod.GET)
	public String showReactIndex() {
		return "index_react";
	}

	@ResponseBody
	@RequestMapping(value = "getReactData.action", method = RequestMethod.POST)
	public Object getReactData(@RequestParam int indexPage) {
		return loggerService.queryLoggerInfoListByPage(indexPage);
	}
}
